package solved;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;

/*
 ID:	liluyan1
 LANG:	JAVA
 TASK:	milk3
 */
public class milk3 {
	public static void main(String[] args) throws IOException {
		BufferedReader f = new BufferedReader(new FileReader("milk3.in"));
		ArrayList<Integer> res = new milk3().solve(f);
		
		PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(
				"milk3.out")));
		Collections.sort(res);
		for (int i=0; i<res.size(); i++) {
			if (i==0) {
				out.print(res.get(i));
			}
			else {
				out.print(" " + res.get(i));
			}
		}
		out.println();
		out.close();
		System.exit(0);
	}
	
	private int[] 				a;
	private HashSet<String> 	visited;
	private ArrayDeque<State> 	queue;
	private ArrayList<Integer>	res;
	
	private ArrayList<Integer> solve(BufferedReader f) throws IOException {
		res = new ArrayList<Integer>();
		a = read(f, 3);
		
		visited = new HashSet<String>();
		queue = new ArrayDeque<State>();
		queue.add(new State(new int[]{0, 0, a[2]}));
		visited.add("0 0 " + a[2]);
		res.add(a[2]);
		
		while (!queue.isEmpty()) {
			State current = queue.remove();
			pour(current, 0, 1);
			pour(current, 1, 0);
			pour(current, 0, 2);
			pour(current, 2, 0);
			pour(current, 1, 2);
			pour(current, 2, 1);
		}
		
		return res;
	}
	
	private void pour(State s, int from, int to) {
		if (s.v[from]==0 || s.v[to]==a[to]) return;
		int[] n = new int[3];
		for (int i=0; i<3; i++) n[i] = s.v[i];
		int amount = Math.min(n[from], a[to] - n[to]);
		n[from] -= amount;
		n[to] += amount;
		
		String id = n[0] + " " + n[1] + " " + n[2];
		if (visited.contains(id)) return;
		
		visited.add(id);
		queue.add(new State(n));
		
		if (n[0] == 0) res.add(n[2]);
	}
	
	public class State {
		int[] v;
		public State(int[] v) {
			this.v = v;
		}
	}
	
	public int[] read(BufferedReader f, int N) throws IOException {
		String[] t = f.readLine().split(" ");
		int[] a = new int[N];
		for (int i=0; i<N; i++) {
			a[i] = Integer.parseInt(t[i]);
		}
		return a;
	}
}
